********************************************************************************
/*

					       Replication of the results of
					 
					 "Quo Vadis? Refugee Centers and the Geographic 
					        Expansion of Far-Right Parties"
						
							       Massimo Pulejo							       

*/
********************************************************************************

                              ***** SET UP *****
							  							  
*ssc install outreg2, replace
*ssc install reghdfe, replace
*ssc install ivreg2, replace
*ssc install ivreghdfe, replace

							  
********************************************************************************
* Please, on line 28 below copy the path of the folder where you put the files *
*   SPRAR_replication_1.dta, SPRAR_replication_2.dta, SPRAR_replication_3.dta  *
*     SPRAR_replication_4.dta, and SPRAR_replication.do on your own machine    *
********************************************************************************

cd "C:\Users\massi\Dropbox\SPRAR_Populism\Replication Package"

use SPRAR_replication_1.dta, clear





                  ***** RESULTS IN MAIN BODY OF PAPER *****	

** Creating Lists of Controls **

* Municipal Controls *
global muncontrols_last pop2011_post pop2011_squared_post popdensity_2011_post ///
sprar_before_2011_post othercenter_post pct_forres_2011_post ///
nonprofit_pc_2011_post unemprate_2011_post avg_income_pc_2012_post ///
average_age2011_post pct_highschool_2011_post pct_agriculture_2011_post ///
pct_industry_2011_post pct_tourism_2011_post estrema_dx_pct2008_post ///
cap_province_post kms_capoluogo_post costa_post pianura_post montagna_post

* Mayoral Controls *
global mayorcontrols_last incumbentlast_college_post incumbentlast_age_post ///
incumbentlast_male_post incumbentlast_mov_post incumbentlast_termlimit_post ///
incumbentlast_farright_post incumbentlast_right_post ///
incumbentlast_farleft_post incumbentlast_farleft_post incumbentlast_civica_post 



*** TABLE 1: REFUGEE CENTERS AND FAR RIGHT RUNNING IN MUNICIPAL ELECTIONS ***

* Column 1: OLS, Baseline *
reghdfe farright_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using Table1, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe farright_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using Table1, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using Table1, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using Table1, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using Table1, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using Table1, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** FIGURE 2: SPRAR CENTERS AND PROBABILITY OF COMPETING, BY TYPE OF PARTY ***

* Running Regressions *
qui ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store farright
ivreghdfe right_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store right
qui ivreghdfe civica_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store civica
ivreghdfe m5s_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store m5s
qui ivreghdfe left_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store left
qui ivreghdfe farleft_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
qui est store farleft

* Producing the Plot *
coefplot farleft left m5s civica right farright, vertical keep(treated_post) yline(0, lpattern(dash)) ysc(r(-3 3)) ylabel(-3(1)3, nogrid) ciopt(recast(rcap)) graphregion(color(white)) plotregion(color(white)) legend(off) ytitle("Effect of SPRAR x Post (DiD Coefficient)", size(medsmall) height(7)) xtitle("", size(medium) height(7)) xlabel(.65 "Far Left" .785 "Left" .92 "M5S" 1.07 "Independent" 1.21 "Right" 1.35 "Far Right", alternate)
graph export "Figure2.jpg", replace



*** FIGURE 3: TIMING OF THE EFFECT ***

** Creating Lists of Controls **

* Time-Varying Controls *
global tv_controls pop pop_squared popdensity pct_forres unemprate nonprofit_pc ///
pct_highschool average_age pct_agriculture pct_industry estrema_dx_pct ///
incumbent_college incumbent_age incumbent_male incumbent_termlimit ///
incumbent_mov incumbent_right incumbent_farright incumbent_left ///
incumbent_farleft incumbent_civica avg_income_pc_2012_P2 avg_income_pc_2012_P1 ///
avg_income_pc_2012_post sprar_before_2011_P2 sprar_before_2011_P1 ///
sprar_before_2011_post othercenter_P2 othercenter_P1 othercenter_post ///
costa_P2 costa_P1 costa_post pianura_P2 pianura_P1 pianura_post montagna_P2 ///
montagna_P1 montagna_post kms_capoluogo_P2 kms_capoluogo_P1 ///
kms_capoluogo_post cap_province_P2 cap_province_P1 cap_province_post

* Election Year x Election Round Dummy *
global ype_last ype1_post ype2_post ype3_post ype4_post ype5_post
global ype_p1 ype1_P1 ype2_P1 ype3_P1 ype4_P1 ype5_P1
global ype_p2 ype1_P2 ype2_P2 ype3_P2 ype4_P2 ype5_P2


** Panel A: SPRAR Not Instrumented **

* Running Regressions *
qui reghdfe farright_competed post_p3 treated_post_p3 post_p2 treated_post_p2 post treated_post post_p1 treated_post_p1 ${ype_p2} ${ype_p1} ${ype_last} ${tv_controls} if election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
qui est store event

* Producing the Plot *
coefplot event, vertical keep(treated_post_p2 treated_post_p1 treated_post) ysc(r(-.06 .1)) ylabel(-.06(.02).1, nogrid) yline(0, lpattern(dash)) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(treated_post_p2 treated_post_p1 treated_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2006-2010" 2 "2011-2015" 3 "2016-2020") xline(2.5,  lcolor(black)) title("Panel A: SPRAR Not Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "Figure3_A.jpg", replace


** Panel B: SPRAR Instrumented **

* Predicting SPRAR Using Instrument *
qui probit treated instrument i.province_code if election_previous1 == 1, cluster(municipality)
qui predict predtreated_last
qui bys municipality(election_number): egen predtreated_last2 = max(predtreated_last)
drop predtreated_last
rename predtreated_last2 predtreated_last
qui gen predtreated_last_post = predtreated_last*post
qui gen predtreated_last_post_p1 = predtreated_last*post_p1
qui gen predtreated_last_post_p2 = predtreated_last*post_p2
qui gen predtreated_last_post_p3 = predtreated_last*post_p3
qui gen predtreated_last_post_p4 = predtreated_last*post_p4

* Running Regressions *
qui reghdfe farright_competed post_p2 predtreated_last_post_p2 post predtreated_last_post post_p1 predtreated_last_post_p1 ${ype_p2} ${ype_p1} ${ype_last} ${tv_controls} if election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
qui est store event

* Producing the Plot *
coefplot event, vertical keep(predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) ysc(r(-.12 .24)) ylabel(-.12(.06).24, nogrid) yline(0, lpattern(dash)) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2006-2010" 2 "2011-2015" 3 "2016-2020") xline(2.5,  lcolor(black)) title("Panel B: SPRAR Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "Figure3_B.jpg", replace



*** TABLE 2: REFUGEE CENTERS AND MATTEO SALVINI'S CAMPAIGN VISITS ***

use SPRAR_replication_2.dta, clear

** Creating Lists of Controls **

* Municipal Controls *
global geodemo pop2001 pop2001_squared popdensity_2001 pct_forres_2001 ///
nonprofit_pc_2001 unemprate_2001 average_age2005 pct_highschool_2001 ///
pct_agriculture_2001 pct_industry_2001 cap_province ///
kms_capoluogo montagna pianura costa 

* Political Controls *
global sociopolitical estrema_dx_pct2006 incumbent_*


** Running Regressions **

* Column 1: OLS, Baseline *
reg campaignvisit sprar i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using Table2, ctitle(OLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, N, Socio-Political Controls, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreg2 campaignvisit i.year_last_election i.province_code (sprar = instrument), cluster(ssl_name) partial(i.year_last_election i.province_code) first savesfirst saverf rf
outreg2 using Table2, ctitle(2SLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, N, Socio-Political Controls, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reg campaignvisit sprar ${geodemo} i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using Table2, ctitle(OLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreg2 campaignvisit ${geodemo} i.year_last_election i.province_code (sprar = instrument), cluster(ssl_name) partial(${geodemo} i.year_last_election i.province_code) first savesfirst saverf rf
outreg2 using Table2, ctitle(2SLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, N) bdec(3) append

* Column 5: OLS, Municipal and Political Controls *
reg campaignvisit sprar ${geodemo} ${sociopolitical} i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using Table2, ctitle(OLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Political Controls *
ivreg2 campaignvisit ${geodemo} ${sociopolitical} i.year_last_election i.province_code (sprar = instrument), cluster(ssl_name) partial(${geodemo} ${sociopolitical} i.year_last_election i.province_code) first savesfirst saverf rf
outreg2 using Table2, ctitle(2SLS) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, Y) bdec(3) append





                     ***** RESULTS IN APPENDIX *****
																	 
*** TABLE A2: DESCRIPTIVE STATISTICS BY GROUP, GEOGRAPHIC AND SOCIOECONOMIC VARIABLES ***

use SPRAR_replication_1.dta, clear

* Identifying Observations Used in Table 1, Column 1 *
qui reghdfe farright_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
qui gen in_baseline_sample = 0
qui replace in_baseline_sample = 1 if e(sample)==1 

* Running T-Tests *
foreach var of varlist instrument montagna pianura costa cap_province kms_capoluogo othercenter nonprofit_pc_2011 pop2011 log_pop2011 popdensity_2011 average_age2011 pct_highschool_2011 unemprate_2011 avg_income_pc_2012 pct_forres_2011 pct_agriculture_2011 pct_industry_2011 pct_tourism_2011  {

ttest `var' if election_previous1 == 1 & in_baseline_sample == 1, by(treated)
}



*** TABLE A3: DESCRIPTIVE STATISTICS BY GROUP, POLITICAL VARIABLES ***

* Running T-Tests *
foreach var of varlist farright_competed farright_totshare estrema_dx_pct2008 incumbentlast_male incumbentlast_age incumbentlast_college incumbentlast_mov incumbentlast_termlimit incumbentlast_farleft incumbentlast_left incumbentlast_civica incumbentlast_right incumbentlast_farright {
	
ttest `var' if election_previous1 == 1 & in_baseline_sample == 1, by(treated)
}



*** TABLE A4: REFUGEE CENTERS AND FAR LEFT RUNNING IN MUNICIPAL ELECTIONS ***

** Creating Lists of Controls **

* Municipal Controls *
global muncontrols_last pop2011_post pop2011_squared_post popdensity_2011_post ///
sprar_before_2011_post othercenter_post pct_forres_2011_post ///
nonprofit_pc_2011_post unemprate_2011_post avg_income_pc_2012_post ///
average_age2011_post pct_highschool_2011_post pct_agriculture_2011_post ///
pct_industry_2011_post pct_tourism_2011_post estrema_dx_pct2008_post ///
cap_province_post kms_capoluogo_post costa_post pianura_post montagna_post

* Mayoral Controls *
global mayorcontrols_last incumbentlast_college_post incumbentlast_age_post ///
incumbentlast_male_post incumbentlast_mov_post incumbentlast_termlimit_post ///
incumbentlast_farright_post incumbentlast_right_post ///
incumbentlast_farleft_post incumbentlast_farleft_post incumbentlast_civica_post 

* Column 1: OLS, Baseline *
reghdfe farleft_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA4, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe farleft_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA4, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe farleft_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA4, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe farleft_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA4, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe farleft_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA4, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe farleft_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA4, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A5: REFUGEE CENTERS AND LEFT RUNNING IN MUNICIPAL ELECTIONS ***

* Column 1: OLS, Baseline *
reghdfe left_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA5, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe left_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA5, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe left_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA5, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe left_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA5, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe left_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA5, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe left_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA5, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A6: REFUGEE CENTERS AND FIVE-STAR MOVEMENT RUNNING IN MUNICIPAL ELECTIONS ***

* Column 1: OLS, Baseline *
reghdfe m5s_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA6, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe m5s_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA6, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe m5s_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA6, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe m5s_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA6, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe m5s_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA6, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe m5s_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA6, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A7: REFUGEE CENTERS AND INDEPENDENTS RUNNING IN MUNICIPAL ELECTIONS ***

* Column 1: OLS, Baseline *
reghdfe civica_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA7, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe civica_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA7, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe civica_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA7, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe civica_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA7, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe civica_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA7, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe civica_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA7, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A8: REFUGEE CENTERS AND RIGHT RUNNING IN MUNICIPAL ELECTIONS ***

* Column 1: OLS, Baseline *
reghdfe right_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA8, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe right_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA8, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe right_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA8, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe right_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA8, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe right_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA8, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe right_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA8, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A9: EXCLUSION RESTRICTION: REDUCED FORM BEFORE AND AFTER 2011 ***

** Post 2011 **

* Column 1: Post 2011, Baseline *
reghdfe farright_competed post instrument_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post instrument_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: Post 2011, Municipal Controls *
reghdfe farright_competed post instrument_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post instrument_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 3: Post 2011, Municipal and Mayoral Controls *
reghdfe farright_competed post instrument_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post instrument_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append


** Pre 2011 **

use SPRAR_replication_3.dta, clear


** Creating Lists of Controls **

* Municipal Controls *
global muncontrols_p2 pop2001_P2 pop2001_squared_P2 popdensity_2001_P2 ///
sprar_before_2011_P2 othercenter_P2 pct_forres_2001_P2 nonprofit_pc_2001_P2 ///
unemprate_2001_P2 average_age2005_P2 pct_highschool_2001_P2 ///
pct_agriculture_2001_P2 pct_industry_2001_P2 cap_province_P2 ///
kms_capoluogo_P2 costa_P2 pianura_P2 montagna_P2

* Mayoral Controls *
global mayorcontrols_p2 incumbentfirst_college_P2 incumbentfirst_age_P2 ///
incumbentfirst_male_P2 incumbentfirst_mov_P2 incumbentfirst_termlimit_P2 ///
incumbentfirst_farright_P2 incumbentfirst_right_P2 incumbentfirst_farleft_P2 ///
incumbentfirst_left_P2 incumbentfirst_civica_P2 

* Column 4: Pre 2011, Baseline *
reghdfe farright_competed post_p2 instrument_post_p2 i.ype_p2 if election_previous3 == 1 | election_previous2 == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post_p2 instrument_post_p2) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 5: Pre 2011, Municipal Controls *
reghdfe farright_competed post_p2 instrument_post_p2 i.ype_p2 ${muncontrols_p2} if election_previous3 == 1 | election_previous2 == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post_p2 instrument_post_p2) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 6: Pre 2011, Municipal and Mayoral Controls *
reghdfe farright_competed post_p2 instrument_post_p2 i.ype_p2 ${muncontrols_p2} ${mayorcontrols_p2} if election_previous3 == 1 | election_previous2 == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA9, ctitle(OLS) nocon tex keep(post_p2 instrument_post_p2) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A10: REFUGEE CENTERS AND FAR RIGHT RUNNING IN MUNICIPAL ELECTIONS, PROBIT REGRESSION MODELS ***

use SPRAR_replication_1.dta, clear

** Creating Lists of Controls **

* Municipal Controls *
global muncontrols_last pop2011_post pop2011_squared_post popdensity_2011_post ///
sprar_before_2011_post othercenter_post pct_forres_2011_post ///
nonprofit_pc_2011_post unemprate_2011_post avg_income_pc_2012_post ///
average_age2011_post pct_highschool_2011_post pct_agriculture_2011_post ///
pct_industry_2011_post pct_tourism_2011_post estrema_dx_pct2008_post ///
cap_province_post kms_capoluogo_post costa_post pianura_post montagna_post

* Mayoral Controls *
global mayorcontrols_last incumbentlast_college_post incumbentlast_age_post ///
incumbentlast_male_post incumbentlast_mov_post incumbentlast_termlimit_post ///
incumbentlast_farright_post incumbentlast_right_post ///
incumbentlast_farleft_post incumbentlast_farleft_post incumbentlast_civica_post 

* Column 1: Probit, Baseline (Note: may take several hours to run!) *
probit farright_competed post treated_post i.ype_post i.municipality_code if election_previous1 == 1 | election_last == 1, cluster(municipality)
outreg2 using TableA10, ctitle(Probit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: IV Probit, Baseline *
ivprobit farright_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, vce(cluster municipality) first 
outreg2 using TableA10, ctitle(IVProbit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: Probit, Municipal Controls (Note: may take several hours to run!) *
probit farright_competed post treated_post i.ype_post ${muncontrols_last} i.municipality_code if election_previous1 == 1 | election_last == 1, cluster(municipality)
outreg2 using TableA10, ctitle(Probit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: IV Probit, Municipal Controls *
ivprobit farright_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, vce(cluster municipality) first 
outreg2 using TableA10, ctitle(IVProbit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: Probit, Municipal and Mayoral Controls (Note: may take several hours to run!) *
probit farright_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} i.municipality_code if election_previous1 == 1 | election_last == 1, cluster(municipality)
outreg2 using TableA10, ctitle(Probit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: IV Probit, Municipal and Mayoral Controls *
ivprobit farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, vce(cluster municipality) first 
outreg2 using TableA10, ctitle(IVProbit) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A11: REFUGEE CENTERS AND FAR RIGHT RUNNING IN MUNICIPAL ELECTIONS, PROVINCE-SPECIFIC TRENDS ***

global prov_last prov*_post

* Column 1: OLS, Baseline *
reghdfe farright_competed post treated_post i.ype_post ${prov_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA11, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe farright_competed post i.ype_post ${prov_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${prov_last}) first savesfirst saverf rf
outreg2 using TableA11, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} ${prov_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA11, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${prov_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${prov_last}) first savesfirst saverf rf
outreg2 using TableA11, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} ${prov_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
outreg2 using TableA11, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} ${prov_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last} ${prov_last}) first savesfirst saverf rf
outreg2 using TableA11, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A12: REFUGEE CENTERS AND FAR RIGHT RUNNING IN MUNICIPAL ELECTIONS, CLUSTERING AT PROVINCE LEVEL ***

* Column 1: OLS, Baseline *
reghdfe farright_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province)
outreg2 using TableA12, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe farright_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA12, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province)
outreg2 using TableA12, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA12, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province)
outreg2 using TableA12, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(province) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA12, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A13: REFUGEE CENTERS AND FAR RIGHT RUNNING IN MUNICIPAL ELECTIONS, CLUSTERING AT LOCAL LABOR MARKET LEVEL ***

* Column 1: OLS, Baseline *
reghdfe farright_competed post treated_post i.ype_post if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name)
outreg2 using TableA13, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) replace

* Column 2: 2SLS, Baseline *
ivreghdfe farright_competed post i.ype_post (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name) partial(i.ype_post) first savesfirst saverf rf
outreg2 using TableA13, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, N, Mayor Controls x Post, N) bdec(3) append

* Column 3: OLS, Municipal Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name)
outreg2 using TableA13, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 4: 2SLS, Municipal Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name) partial(i.ype_post ${muncontrols_last}) first savesfirst saverf rf
outreg2 using TableA13, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, N) bdec(3) append

* Column 5: OLS, Municipal and Mayoral Controls *
reghdfe farright_competed post treated_post i.ype_post ${muncontrols_last} ${mayorcontrols_last} if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name)
outreg2 using TableA13, ctitle(OLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append

* Column 6: 2SLS, Municipal and Mayoral Controls *
ivreghdfe farright_competed post i.ype_post ${muncontrols_last} ${mayorcontrols_last} (treated_post = instrument_post) if election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(ssl_name) partial(i.ype_post ${muncontrols_last} ${mayorcontrols_last}) first savesfirst saverf rf
outreg2 using TableA13, ctitle(2SLS) nocon tex keep(post treated_post) addtext(Municipality FEs, Y, Mun. Controls x Post, Y, Mayor Controls x Post, Y) bdec(3) append



*** TABLE A14: REFUGEE CENTERS AND MATTEO SALVINI'S CAMPAIGN VISITS, PROBIT REGRESSIONS ***

use SPRAR_replication_2.dta, clear


** Creating Lists of Controls **

* Municipal Controls *
global geodemo pop2001 pop2001_squared popdensity_2001 pct_forres_2001 ///
nonprofit_pc_2001 unemprate_2001 average_age2005 pct_highschool_2001 ///
pct_agriculture_2001 pct_industry_2001 cap_province ///
kms_capoluogo montagna pianura costa 

* Political Controls *
global sociopolitical estrema_dx_pct2006 incumbent_*

* Column 1: Probit, Baseline *
probit campaignvisit sprar i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using TableA14, ctitle(Probit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, N, Socio-Political Controls, N) bdec(3) replace

* Column 2: IV Probit, Baseline *
ivprobit campaignvisit i.year_last_election i.province_code (sprar = instrument), vce(cluster ssl_name) first 
outreg2 using TableA14, ctitle(IVProbit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, N, Socio-Political Controls, N) bdec(3) append

* Column 3: Probit, Municipal Controls *
probit campaignvisit sprar ${geodemo} i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using TableA14, ctitle(Probit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, N) bdec(3) append

* Column 4: IV Probit, Municipal Controls *
ivprobit campaignvisit ${geodemo} i.year_last_election i.province_code (sprar = instrument), vce(cluster ssl_name) first 
outreg2 using TableA14, ctitle(IVProbit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, N) bdec(3) append

* Column 5: Probit, Municipal and Mayoral Controls *
probit campaignvisit sprar ${geodemo} ${sociopolitical} i.year_last_election i.province_code, cluster(ssl_name)
outreg2 using TableA14, ctitle(Probit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, Y) bdec(3) append

* Column 6: IV Probit, Municipal and Mayoral Controls *
ivprobit campaignvisit ${geodemo} ${sociopolitical} i.year_last_election i.province_code (sprar = instrument), vce(cluster ssl_name) first 
outreg2 using TableA14, ctitle(IVProbit) nocon tex keep(sprar) addtext(Province FEs, Y, Geo/Demo Controls, Y, Socio-Political Controls, Y) bdec(3) append



*** FIGURE A1: NEW MUNICIPALITIES JOINING SPRAR, BY YEAR ***

use SPRAR_replication_1.dta, clear

* Note: Please run lines 625-629 below all at once, so as to preserve the data! *

preserve
collapse year_got_sprar, by(municipality)
histogram year_got_sprar, discrete addlabels frequency graphregion(color(white)) plotregion(color(white)) color(navy) xtitle("Year", size(medium) height(7) color(black)) xlabel(2005(1)2020, angle(vertical)) ytitle("Municipalities Joining SPRAR", size(medium) height(7) color(black)) ylabel(, nogrid)
graph export "FigureA1.jpg", replace
restore



*** FIGURE A2: TIMING OF THE EFFECT, WITHOUT COVARIATES ***

* Election Year x Election Round Dummy *
global ype_last ype1_post ype2_post ype3_post ype4_post ype5_post
global ype_p1 ype1_P1 ype2_P1 ype3_P1 ype4_P1 ype5_P1
global ype_p2 ype1_P2 ype2_P2 ype3_P2 ype4_P2 ype5_P2

** Panel A: SPRAR Not Instrumented **

* Running Regressions *
reghdfe farright_competed post_p2 treated_post_p2 post treated_post post_p1 treated_post_p1 ${ype_p2} ${ype_p1} ${ype_last} if election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
est store event

* Producing the Plot *
coefplot event, vertical keep(treated_post_p2 treated_post_p1 treated_post) ysc(r(-.06 .1)) ylabel(-.06(.02).1, nogrid) yline(0, lpattern(dash)) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(treated_post_p2 treated_post_p1 treated_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2006-2010" 2 "2011-2015" 3 "2016-2020") xline(2.5,  lcolor(black)) title("Panel A: SPRAR Not Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "FigureA2_A.jpg", replace


** Panel B: SPRAR Instrumented **

* Predicting SPRAR Using Instrument *
qui probit treated instrument i.province_code if election_previous1 == 1, cluster(municipality)
qui predict predtreated_last
qui bys municipality(election_number): egen predtreated_last2 = max(predtreated_last)
drop predtreated_last
rename predtreated_last2 predtreated_last
qui gen predtreated_last_post = predtreated_last*post
qui gen predtreated_last_post_p1 = predtreated_last*post_p1
qui gen predtreated_last_post_p2 = predtreated_last*post_p2
qui gen predtreated_last_post_p3 = predtreated_last*post_p3
qui gen predtreated_last_post_p4 = predtreated_last*post_p4

* Running Regressions *
reghdfe farright_competed post_p2 predtreated_last_post_p2 post predtreated_last_post post_p1 predtreated_last_post_p1 ${ype_p2} ${ype_p1} ${ype} if election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
est store event

* Producing the Plot *
coefplot event, vertical keep(predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) ylabel(-.2(.05).2, nogrid) yline(0, lpattern(dash)) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2006-2010" 2 "2011-2015" 3 "2016-2020") xline(2.5,  lcolor(black)) title("Panel B: SPRAR Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "FigureA2_B.jpg", replace



*** FIGURE A3: TIMING OF THE EFFECT, INCLUDING 2001-2005 ***

use SPRAR_replication_4.dta, clear

** Creating Lists of Controls **

* Time-Varying Controls *
global tv_controls pop pop_squared popdensity pct_forres unemprate nonprofit_pc ///
pct_highschool average_age pct_agriculture pct_industry estrema_dx_pct ///
incumbent_college incumbent_age incumbent_male incumbent_termlimit ///
incumbent_mov incumbent_right incumbent_farright incumbent_left ///
incumbent_farleft incumbent_civica sprar_before_2011_P3 sprar_before_2011_P2 ///
sprar_before_2011_P1 sprar_before_2011_post othercenter_P3 othercenter_P2 ///
othercenter_P1 othercenter_post costa_P3 costa_P2 costa_P1 costa_post ///
pianura_P3 pianura_P2 pianura_P1 pianura_post montagna_P3 montagna_P2 ///
montagna_P1 montagna_post kms_capoluogo_P3 kms_capoluogo_P2 kms_capoluogo_P1 ///
kms_capoluogo_post cap_province_P3 cap_province_P2 cap_province_P1 cap_province_post

* Election Year x Election Round Dummy *
global ype_last ype1_post ype2_post ype3_post ype4_post ype5_post
global ype_p1 ype1_P1 ype2_P1 ype3_P1 ype4_P1 ype5_P1
global ype_p2 ype1_P2 ype2_P2 ype3_P2 ype4_P2 ype5_P2
global ype_p3 ype1_P3 ype2_P3 ype3_P3 ype4_P3 ype5_P3


** Panel A: SPRAR Not Instrumented **

* Running Regressions *
reghdfe farright_competed post_p3 treated_post_p3 post_p2 treated_post_p2 post treated_post post_p1 treated_post_p1 ${ype_p3} ${ype_p2} ${ype_p1} ${ype_last} ${tv_controls} if election_previous3 == 1 | election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
est store event

* Producing the Plot *
coefplot event, vertical keep(treated_post_p3 treated_post_p2 treated_post_p1 treated_post) yline(0, lpattern(dash)) ylabel(, nogrid) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(treated_post_p3 treated_post_p2 treated_post_p1 treated_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2001-2005" 2 "2006-2010" 3 "2011-2015" 4 "2016-2020") xline(3.5,  lcolor(black)) title("Panel A: SPRAR Not Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "FigureA3_A.jpg", replace


** Panel B: SPRAR Instrumented **

* Predicting SPRAR Using Instrument *
encode province, gen(province_code)
probit treated instrument i.province_code if election_previous1 == 1, cluster(municipality)
predict predtreated_last
bys municipality(election_number): egen predtreated_last2 = max(predtreated_last)
drop predtreated_last
rename predtreated_last2 predtreated_last
gen predtreated_last_post = predtreated_last*post
gen predtreated_last_post_p1 = predtreated_last*post_p1
gen predtreated_last_post_p2 = predtreated_last*post_p2
gen predtreated_last_post_p3 = predtreated_last*post_p3
gen predtreated_last_post_p4 = predtreated_last*post_p4

* Running Regressions *
reghdfe farright_competed post_p3 predtreated_last_post_p3 post_p2 predtreated_last_post_p2 post predtreated_last_post post_p1 predtreated_last_post_p1 ${ype_p3} ${ype_p2} ${ype_p1} ${ype_last} ${tv_controls} if election_previous3 == 1 | election_previous2 == 1 | election_previous1 == 1 | election_last == 1, absorb(municipality) cluster(municipality)
est store event

* Producing the Plot *
coefplot event, vertical keep(predtreated_last_post_p3 predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) yline(0, lpattern(dash)) ylabel(, nogrid) ciopt(recast(rcap)) recast(scatter) omitted baselevels order(predtreated_last_post_p3 predtreated_last_post_p2 predtreated_last_post_p1 predtreated_last_post) graphregion(color(white)) plotregion(color(white)) xlabel(1 "2001-2005" 2 "2006-2010" 3 "2011-2015" 4 "2016-2020") xline(3.5,  lcolor(black)) title("Panel B: SPRAR Instrumented", size(medsmall) height(7) color(black)) ytitle("SPRAR x Election Coefficient", size(medsmall) height(7) color(black)) xtitle("Municipal Election Round", size(medium) height(7) color(black))
graph export "FigureA3_B.jpg", replace